/**
 * 
 */
package com.chenzehe.alimama.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.chenzehe.alimama.domain.Product;
import com.chenzehe.alimama.html.LoginPage;
import com.chenzehe.alimama.html.NvzhuangListPage;
import com.chenzehe.java.core.freemarker.HtmlPathHelp;

/**
 * @description
 * @author chenzehe
 * @email hljuczh@163.com
 * @create 2013年11月20日 下午4:14:00
 */
@Controller
public class QunAction extends BaseAction {
	// String username = "已有19999人购买";
	// String password = "q123123";

	String username = "hljuczh";
	String password = "";

	int endPageNo = 2;

	@RequestMapping(value = "/qun/nvzhuang.html")
	public String nvzhuang(HttpServletRequest request, ModelMap model) {

		// 实例化登录页面并登录
		LoginPage loginPage = new LoginPage(getWebDriver());
		loginPage.login(username, password);
		// 淘客群女装列表
		NvzhuangListPage nvzhuang = new NvzhuangListPage(getWebDriver(),
				username);
		List<Product> listProducts = null;
		for (int pageNo = 1; pageNo <= endPageNo; pageNo++) {
			System.out.println("pageNo:" + pageNo);
			listProducts = nvzhuang.getProductList(pageNo);
		}

		return HtmlPathHelp.getHtmlPathFront("nvzhuang");
	}

	@RequestMapping(value = "/qun/nanzhuang.html")
	public String nanzhuang(HttpServletRequest request, ModelMap model) {
		return HtmlPathHelp.getHtmlPathFront("search");
	}

}
